package javax.per.toolkit.xml;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Node;

public class NodeFindOperator implements INodeOperator{

	private List<Node> list=new ArrayList<Node>();
	private String[] nodeName=null;
	
	public NodeFindOperator(String[] name){
		this.nodeName=name;
	}
	
	@Override
	public void operator(Node node) {
		boolean isEqual=false;
		for(int i=0;i<nodeName.length;i++){
			if(node.getNodeName().trim().equals(nodeName[i])){
				isEqual=true;
				break;
			}
		}
		if(isEqual)
			list.add(node);
	}
	
	public List<Node> getResult(){
		return this.list;
	}

}
